// "Icon"/thumbnail cell renderer
// Copyright 2006 (C) Ralph Thomas

#ifndef MISSION_VIEW_GTK_FLYWEIGHT_CELL_RENDERER_ICON_H
#define MISSION_VIEW_GTK_FLYWEIGHT_CELL_RENDERER_ICON_H

#include <gtk/gtk.h>
#include <string>
#include <boost/function.hpp>
#include <boost/signals.hpp>

//
// This code is based on the "custom cell renderer" sample in the
// GTK+ tree view tutorial.
//
#define MISSION_TYPE_CELL_RENDERER_ICON             (mission_cell_renderer_icon_get_type())
#define MISSION_CELL_RENDERER_ICON(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),  MISSION_TYPE_CELL_RENDERER_ICON, MissionCellRendererIcon))
#define MISSION_CELL_RENDERER_ICON_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass),  MISSION_TYPE_CELL_RENDERER_ICON, MissionCellRendererIconClass))
#define MISSION_IS_CELL_ICON_ICON(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MISSION_TYPE_CELL_RENDERER_ICON))
#define MISSION_IS_CELL_ICON_ICON_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass),  MISSION_TYPE_CELL_RENDERER_ICON))
#define MISSION_CELL_RENDERER_ICON_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj),  MISSION_TYPE_CELL_RENDERER_ICON, MissionCellRendererIconClass))

typedef struct _MissionCellRendererIcon MissionCellRendererIcon;
typedef struct _MissionCellRendererIconClass MissionCellRendererIconClass;


struct MissionCellRendererIconPrivate {
	std::string								icon_m;
	unsigned int							index_m;
	unsigned int							size_m;
	boost::function<void (unsigned int)>	inval_m;
};
/* CustomCellRendererProgress: Our custom cell renderer
 *   structure. Extend according to need */

struct _MissionCellRendererIcon {
	GtkCellRenderer   				parent;
	MissionCellRendererIconPrivate* data;
};


struct _MissionCellRendererIconClass
{
	GtkCellRendererClass  parent_class;
};


GType                mission_cell_renderer_icon_get_type (void);
GtkCellRenderer     *mission_cell_renderer_icon_new (void);
void				 mission_cell_renderer_icon_set_notify_function(GtkCellRenderer* object, const boost::function<void (unsigned int)>& notify);
boost::signals::connection mission_cell_renderer_icon_inval(const boost::function<void ()>& f);

#endif

